package cn;

import org.redisson.Redisson;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * @Author   lyw
 * @Description 秒杀模块provider
 * @Date 12:29 2021/7/24
 * @Param
 * @return
 */
@SpringBootApplication
@EnableDiscoveryClient
@MapperScan(basePackages="cn.*.*.*.mapper")
public class SeckillProviderServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(SeckillProviderServerApplication.class, args);
    }

    @Bean
    public Redisson redisson(){

        //单机模式
        Config config = new Config();
        config.useSingleServer().setAddress("redis://82.156.15.59:6379").setDatabase(12).setPassword("root");
        return (Redisson)Redisson.create(config);
    }
}
